package org.example.medical.Mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.medical.entity.AdmissionRecord;

import java.util.List;

@Mapper
public interface AdmissionRecordMapper {
    // 查询住院记录分页数据（按患者姓名）
    List<AdmissionRecord> selectByPageAndFilters(
            @Param("patientName") String patientName,
            @Param("admissionDate") String admissionDate,
            @Param("dischargeDate") String dischargeDate,
            @Param("offset") int offset,
            @Param("size") int size
    );

    // 新增住院记录
    void insertAdmissionRecord(AdmissionRecord admissionRecord);

    // 更新住院记录
    void updateAdmissionRecord(AdmissionRecord admissionRecord);

    // 软删除住院记录
    void softDeleteAdmissionRecord(@Param("recordId") Long recordId);

    // 批量软删除住院记录
    void batchSoftDeleteAdmissionRecords(@Param("recordIds") List<Long> recordIds);

    List<Long> getRecordIdsByPatientId(int patientId);
}